
$(document).ready(function() { 
	$('#unified-add .tab a').click(function() {
		var panel = $(this).attr('id');
		$('#unified-add li').removeClass('active');
		$('#unified-add #'+panel).parent().addClass('active');
		if (! $('#unified-add #'+panel+'-form').is(':visible')) {
			$('#unified-add .unified-form').hide();
			$('#unified-add #'+panel+'-form').show();
		}		
	});
	
	$('.unified-main').focus(function() {
		var id = $(this).attr('alt');
		$('.unified-more-'+id).show();		
	});
	
	$('.unified-show-more-a').click(function() {
		var id = $(this).attr('id');
		$(this).hide();
		$('#unified-more-'+id).show();
	});
	
	$('.unified-collapse').click(function() {
		var id = $(this).attr('id').replace("collapse-","");
		$('.unified-more-'+id).hide();
		$('.form-more').hide();
		$('.unified-show-more-a').show();
		return false;
	});
	
	/*
	 * Execute the active tab's click event to select that form
	 */
	$('.active.tab').find('a').click();
});
